package com.xs.gis.cover.coverImpl;

import com.xs.gis.cover.SimpleCover;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.io.ParseException;
import org.locationtech.jts.io.WKTReader;
import org.locationtech.jts.io.WKTWriter;

/**
 * @description:
 * @author: w
 * @create: 2023-08-17 17:43
 **/
public class WktCover implements SimpleCover {


    @Override
    public Geometry dataToGeometry(String data) throws ParseException {
        WKTReader reader = new WKTReader();
        return reader.read(data);
    }

    @Override
    public String geometryToData(Geometry geometry) {
        WKTWriter writer = new WKTWriter();
        return writer.write(geometry);
    }
}
